<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<a href="">aa</a>
	<h3>这是用户的列表页</h3>
	<h3><a href="<?php echo U('User/add');?>">添加用户</a></h3>
	<form action="" >	通过get方式请求当前页面，完成搜索任务
		<input type="text" name="username" value="" placeholder="请输入你的用户名">
		<input type="text" name="age" value="" placeholder="你输入年龄">
		<button>搜索</button>
	</form>
	<br><br>

	<table width="500" border="1">
		<tr>
			<th>编号</th>
			<th>姓名</th>
			<th>年龄</th>
			<th>性别</th>
			<th>班期</th>
			<th>操作</th>
		</tr>
		<?php if(is_array($data)): foreach($data as $key=>$vo): ?><tr>
			<td><?php echo ($vo['id']); ?></td>
			<td><?php echo ($vo['username']); ?></td>
			<td><?php echo ($vo['age']); ?></td>
			<td><?php echo ($vo['sex']==1 ? '男' : '女'); ?></td>
			<td><?php echo ($vo['classid']); ?></td>
			<td>
				<a href="<?php echo U('User/edit', ['id'=>$vo['id']]);?>">修改</a>
				<a href="<?php echo U('User/delete', ['id'=>$vo['id']]);?>">删除</a>
			</td>
		</tr><?php endforeach; endif; ?>
		<tr>
			<td colspan="6"><?php echo ($show); ?></td>
		</tr>
	</table>

	<script>
	// js语法
	var id = 3;

	// U():PHP语法
	location.href = "<?php echo U('Index/index');?>?id="+id;

	var age = 20;

	<?php if($age > age): ?>你的年龄超过20岁<?php endif; ?>

	if (age > <?php echo ($age); ?>) {
		alert('ok');
	} else {
		alert('no');
	}

	/*
		Plupload文件上传
	*/
	</script>
</body>
</html>